package com.sacc.controller;

import com.power.common.model.CommonResult;
import com.sacc.pojo.ProductCart;
import com.sacc.service.Impl.ProductCartServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 滚~韬
 * @date 2022/4/8 13:25
 */
@RestController
@RequestMapping("/product/cart")
public class ProductCartController {
    @Autowired
    private ProductCartServiceImpl productCartService;
    //获取购物车信息
    @GetMapping("/get")
    public List<Integer> Get(@RequestParam String openId){
        return productCartService.Get(openId);
    }
    //删除购物车信息
    @PostMapping("/delete")
    public CommonResult Delete(@RequestBody ProductCart productCart){
        return productCartService.Delete(productCart);
    }
    //增加购物车信息
    @PostMapping("/add")
    public CommonResult Add(@RequestBody ProductCart productCart){
        return productCartService.Add(productCart);
    }
}
